package other;

import java.math.BigInteger;

/**
 * @program: javase
 * @description: 大整数运算
 * @author: lld
 * @create: 2021-04-09 10:22
 **/
public class BigIntegerTest {
    public static void main(String[] args) {
        long a1=1111122222222222333L;
        long b1=4565542897645334237L;
        System.out.println(a1*b1);//使用int，long都会越界

        BigInteger a = new BigInteger("1111122222222222333");
        BigInteger b = new BigInteger("4565542897645334237");

        System.out.println(a.add(b));
        System.out.println(a.subtract(b));
        System.out.println(a.multiply(b));
        System.out.println(a.divide(b));
    }
}
